#include<vector>

class Solution {
public:
    vector<int> reverseBookList(ListNode* head) {
        ListNode* cur = head;
        vector<int> tmp, ret;

        while (cur) {
            tmp.push_back(cur->val);
            cur = cur->next;
        }

        int n = tmp.size();
        ret.resize(n);

        for (int i = 0; i < n; i++)
            ret[i] = tmp[n - 1 - i];
        return ret;
    }
};